<?php
namespace cdocument\cdocument;

/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2019/11/1
 * Time: 15:15
 */

class CDocument
{
    static $obj;
    public static function getInstance(){
        return empty(static::$obj) ? (static::$obj = new CDocument()) : static::$obj;
    }


    public $arr_class;
    public function addClass( $class ){
        if(!isset($this->arr_class[$class])){
            $this->arr_class[$class] = new \ReflectionClass($class);
        }
    }

    public function show(){
        if(empty($this->arr_class)){
            return "没有数据";
        }

        foreach ($this->arr_class as $k => $class){
            $properties = $class->getProperties();
            foreach ($properties as $property) {
                echo $property->getName() . "\n";
            }
        }
    }
}